package com.yingyi.basic.query;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 基本的分页查询条件
 */
@ApiModel(description = "基本查询参数")
@Data
public class BaseQuery {
    @ApiModelProperty(value = "当前页数",required=true, example = "1")
    private Integer currentPage = 1;

    @ApiModelProperty(value = "每页条数",required=true , example = "1")
    private Integer pageSize = 5;

    @ApiModelProperty(value = "关键字查询",required=false)
    private String keywords;

    //limit的第一个参数值
    public Integer getBegin(){
        return (this.currentPage - 1) * this.pageSize;
    }
}
